package cn.edu.controller;

import cn.edu.domain.PageBean;
import cn.edu.domain.opus;
import cn.edu.domain.research_project;
import cn.edu.service.lead_OpusService;
import cn.edu.service.lead_ProjectService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author Davey chan
 */
@RestController
@RequestMapping("/lead_Opus")
public class lead_OpusController {
    @Autowired
    private lead_OpusService opusService;
    //分页查询
    @RequestMapping("/selectByPage")
    public Result selectByPage(Integer currentPage,
                             Integer pageSize,
                           String OpusDate,
                             @RequestBody opus t){
        if(!OpusDate.equals("null") && OpusDate.length()>0 ){
            String[] split = OpusDate.split(",");
            t.setBeginTime(split[0]);
            t.setEndTime(split[1]);

        }
        PageBean<opus> pageBean = opusService.selectByPageAndcondition(currentPage, pageSize,t);
        return new Result(Code.GET_OK,pageBean);
    }


}
